/*
 * @Author: 谢小康 2170673706@qq.com
 * @Date: 2024-01-02 14:29:02
 * @LastEditors: 谢小康 2170673706@qq.com
 * @LastEditTime: 2024-01-30 20:58:11
 * @FilePath: \My-bolg\server\router\photo.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const express = require('express');
const router = express.Router();
const {
    addaumble,
    submitFileName,
    editaumble,
    getaumble,
    getcount,
    addPic,
    getPic,
    alltotaldata,
    deletePic,
    delectaumbles
}=require("../controller/photo.js")

const {isSuperAdmin} = require('../controller/user.js')
const {paramsValidata,paramsValidataPic,paramsValidataGet} = require('../middleware/photo.js')
const { auth } = require('../util/user');
/* 添加相册 */
router.post('/addaumble',auth,paramsValidata,isSuperAdmin,addaumble)
/* 添加相册图片 */
router.post('/submitFileName',auth,isSuperAdmin,submitFileName)
/* 编辑相册 */
router.post('/editaumble',auth,isSuperAdmin,editaumble)
/* 分页获取相册 */
router.post("/getaumble",paramsValidataGet,getaumble)
/* 获取相册数量 */
router.get("/getcount",auth,getcount)
/* 添加照片 */
router.post('/addPic',auth,paramsValidataPic,isSuperAdmin,addPic)
/* 获取对应的图片 */
router.post("/getPic",paramsValidataGet,getPic)
/* 图片数量 */
router.get("/alltotaldata",auth,alltotaldata)
/* 批量删除图片 */
router.post("/deletePic",auth,isSuperAdmin,deletePic)
router.post("/delectaumbles",auth,isSuperAdmin,delectaumbles)
module.exports = router;